package system.servlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.hitrust.gs.dao.GSOutSubHisBaeanDAO;

public class OutSubHisDataInitServlet extends HttpServlet{
	
	protected void doPost(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		String year = (String) req.getParameter("year");
		try {
			dao.createTableByYear(year);
		} catch (Exception e) {
			e.printStackTrace();
		}
		resp.sendRedirect("http://127.0.0.1:7001/gw");
	}
	
	protected void doGet(HttpServletRequest req, HttpServletResponse resp)
		throws ServletException, IOException {
		// TODO Auto-generated method stub
		this.doPost(req, resp);
	}
	
	GSOutSubHisBaeanDAO dao = new GSOutSubHisBaeanDAO();
}
